const distinguish = (front, after) => {
  const arr = [];
  let flag = true;

  for(let i = 0, n = front.length; i < n; i++) {
    flag = true;
    for(let j = 0, m = after.length; j < m; j++) {
      if(front[i] === after[j]) {
        flag = false;
        after.splice(j, 1);
        break;
      }
      flag = true;
    }
    if(flag) {
      arr.push(front[i]);
    }
  }

  return arr;
}

export default distinguish;